package com.sc.VenusQueryBeta.presenter.vip;

import com.hengjun.kingstar.sdk.utils.LogUtils;
import com.sc.VenusQueryBeta.contract.vip.VipRootContract;
import com.sc.VenusQueryBeta.model.bean.AboutVGSBean;
import com.sc.VenusQueryBeta.model.vip.VipRootModel;


import io.reactivex.functions.Consumer;

/**
 * Created by Administrator on 2018/10/26.
 *
 */

public class VipRootPresenter extends VipRootContract.VipRootPresenter {
    @Override
    protected VipRootContract.IVipRootModel getModel() {
        return VipRootModel.newInstance();
    }

    @Override
    public void onStart() {

    }
    public static VipRootPresenter newInstance(){
        return new VipRootPresenter();
    }

    @Override
    public void aboutVGS(long id) {
        mRxManager.register(mIModel.aboutVGS(id).subscribe(new Consumer<AboutVGSBean>() {
            @Override
            public void accept(AboutVGSBean aboutVGSBean) throws Exception {
                //   LogUtils.e("是这里报错hhhhh");
                if (mIView != null)
                    mIView.showAboutVGSDataSuccess(aboutVGSBean);
            }
        }, new Consumer<Throwable>() {
            @Override
            public void accept(Throwable throwable) throws Exception {
                // LogUtils.e("是这里报错");
                if (mIView != null)
                    //  mIView.showToast("Network error.33");
                    mIView.showNetworkError(throwable);
                LogUtils.e("是这里报错");
            }
        }));
    }
}
